package net.web.struts.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.handler.ArithmaticProcessHandler;
import net.handler.IProcessHandler;
import net.web.struts.action.form.AddActionForm;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class AddAction extends BaseAction {
	
	public ActionForward display(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		AddActionForm aaform = (AddActionForm) form;
		//Get Handler
		ArithmaticProcessHandler handler = (ArithmaticProcessHandler) getHandler(request);
		//Set Question
		setQuestionData(request, handler, aaform);
		return mapping.findForward("display");
	} //home

	@Override
	public IProcessHandler getHandler(HttpServletRequest request) {
		return new ArithmaticProcessHandler(getOperation());
	}

}
